package com.tandashi.springbootstudy01.util;

import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;

public class QueryUtils {

    public static void termQuery(BoolQueryBuilder queryBuilder, String value, String field) {
        if (StringUtils.isNoneBlank(value)) {
            queryBuilder.must(QueryBuilders.termQuery(field, value));
        }
    }

}
